# -*- mode: snippet -*-
# name: <div ng-form="frm"><input type="text" /><span class="error" /></div>
# key: ainp.
# contributor: Chen Bin <chenbin DOT sh AT gmail>
# --
<div class="form-group">
  <label class="control-label">${2:Credit}</label>
  <input class="form-control" type="text" ng-model="userAccount.${3:credit}" name="${3:$(yas/substr yas-text "[^ ]*")}" ng-pattern="/^${4:pattern}\$/" >
  <small ng-show="${1:frm}.${3:$(yas/substr yas-text "[^ ]*")}.$touched && ${1:$(yas/substr yas-text "[^ ]*")}.${3:$(yas/substr yas-text "[^ ]*")}.$error.pattern" class="has-error">Error message</small>
</div>